package tools;

import java.sql.Connection;
import java.sql.DriverManager;
public class JDBCTool {


    public static Connection getConnection() throws Exception{

        Class.forName("com.mysql.cj.jdbc.Driver");
        String url = "jdbc:mysql://localhost:3306/user?characterEncoding=UTF-8&useSSL=false&useUnicode=true&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true";
        String username = "root";
        String password = "123456";
        return DriverManager.getConnection(url,username,password);
    }
}
